home *** CD-ROM | disk | FTP | other *** search
- Path: news.IT.net!news
- From: gema001@pn.itnet.it (Antonio Romeo)
- Newsgroups: comp.lang.c
- Subject: Re: Processing text file
- Date: 2 Apr 1996 13:51:32 GMT
- Organization: CyberPress
- Message-ID: <4jrbd4$a19@dns1.IT.net>
- References: <4jr7l9$6on@harbinger.cc.monash.edu.au>
- NNTP-Posting-Host: gema001.pn.itnet.it
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- In article <4jr7l9$6on@harbinger.cc.monash.edu.au>,
- nallan@yoyo.cc.monash.edu.au says...
- >
- >Hi everyone
- >I'm kind of new to c, so please be gentle.
- >I'm trying to write a program that reads a text file, a line at a
- time,
- >does some processing and outputs to another text file.
- >The input text file has the same format for every line with the
- exception
- >of on ocation the last field is sometimes blank.
- >The lines are not the same length.
- >
- >Can someone give me ideas on the best way to handle this. I've tried
- a
- >few methods
- >but I can't seem to get it to work. My main problem is the variable
- >length in the input file.
- Try using gets() function. This read a string from a file until '\n'
- char.
- '\n' is not placed in string, so you can read entire line regardless
- lenght.
-
-
- --
- Antonio Romeo - Rome - Italy
- e-mail: gema001@pn.itnet.it
-
-